package com.bigstar.lolen_e;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TabHost;

import com.google.ads.AdRequest;
import com.google.ads.AdView;

public class Builder extends TabActivity{
	
	public static boolean item_select;
	
	public static int[][] masteries = new int[3][17];
	
    @Override
    protected void onResume() {
    	super.onResume();
        ChampionData.load(this);
        ItemData.load(this);
        Rune.load(this);
    }
    
	
	@Override 
	public void onCreate(Bundle savedInstanceState) { 
		super.onCreate(savedInstanceState); 
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 
        ChampionData.load(this);
        ItemData.load(this);
        Rune.load(this);
		setContentView(R.layout.builder); 
        AdView adview = (AdView)findViewById(R.id.adView);
        AdRequest re = new AdRequest(); 
        adview.loadAd(re);
		 TabHost tabHost = getTabHost(); 
		 TabHost.TabSpec spec; 
		 Intent intent; 
		 intent = new Intent(this, BuilderChampion.class);
		 spec = tabHost.newTabSpec("Champion").setIndicator("Champion") 
				 .setContent(intent);
		 tabHost.addTab(spec); 
 		 
		 intent = new Intent(this, BuilderItem.class); 
		 spec = tabHost.newTabSpec("Item").setIndicator("Item") 
				 .setContent(intent); 
		 tabHost.addTab(spec); 
 		 
		 intent = new Intent(this, Rune.class); 
		 spec = tabHost.newTabSpec("Rune").setIndicator("Rune") 
				 .setContent(intent);
		 tabHost.addTab(spec); 
		 
		 intent = new Intent(this, Masteries.class); 
		 intent.putExtra("builder", "on");
		 spec = tabHost.newTabSpec("Masterie").setIndicator("Masterie") 
				 .setContent(intent);
		 tabHost.addTab(spec); 
	}
	
    public static int getMasteriesPoint(int masterie){
    	int point = 0;
    	for(int i = 0; i < masteries[masterie].length; i++){
    		point += masteries[masterie][i];
    	}
    	return point;
    }
    public static int getMasteriesCount(){
    	int count = getMasteriesPoint(0);
    	count += getMasteriesPoint(1);
    	count += getMasteriesPoint(2);
    	return count;
    }
}
